package com.game.module.${moduleName?lower_case}.structs;

import java.util.HashMap;
import java.util.Map;
import java.util.List;
import java.util.ArrayList;
import com.game.module.player.component.PlayerBean;
import common.persistence.annotation.DataConverter;
import common.persistence.annotation.TableName;
import com.game.module.${moduleName?lower_case}.persistence.${entityName}BeanConverter;

/**
* ${entityName}Bean
* @date ${.now?string("yyyy-MM-dd HH:mm:ss")}
*/
@TableName("${tablName}")
@DataConverter(${entityName}BeanConverter.class)
public class ${entityName}Bean implements PlayerBean {

	<#-- filed -->
	<#if entityBeans ? exists>
	<#list entityBeans as bean>
	/**
	* ${bean.desc}
	*/
	private ${bean.type} ${bean.field};
	</#list>
	</#if>
    /**
     *boolean 发生改变
     */
    private transient boolean change;
	
	<#-- Constructor -->
	public ${entityName}Bean(){
		<#if entityBeans ? exists>
		<#list entityBeans as bean>
		<#if bean.type == 'String'>
		this.${bean.field} = "";
		<#elseif bean.type ? starts_with('Map')>
		this.${bean.field} = new HashMap<>();
		</#if>
		</#list>
		</#if>
	}
	
	<#-- Getter Setter-->
	<#if entityBeans ? exists>
	<#list entityBeans as bean>
	/** ${bean.desc} **/
	public ${bean.type} get${bean.field ? cap_first}(){
		return this.${bean.field};
	}
	
	public void set${bean.field ? cap_first}(${bean.type} ${bean.field}){
		this.${bean.field} = ${bean.field};
	}
	</#list>
	</#if>
	
	@Override
    public boolean isChange() {
        return change;
    }

    @Override
    public void setChange(boolean change) {
        this.change = change;
    }
	
	@Override
	public String toString() {
		return ${toStr}
	}
	
}
